import { defineStore } from 'pinia'
import { hotGetList } from "../../api/hotTop/index"
interface State {
   //列表
   hotlist: HotArticle[]


}

interface HotArticle {
  "briefs": string,
  "hotCounts": string,
  "imgUrl": string,
  "link": string,
  "title":string
}

export const HotStore = defineStore('hotTop', {
  //属性
  state: (): State => {
    return {
        hotlist: []
     
    }
  },
  //数据处理
  getters: {
  },
  //函数
  actions: {
    //获取评论列表
    async getListData() {
      try {
        const res: any = await hotGetList();
        this.hotlist = res.data
      }
      catch (error) {

      }

    }


  },

})